<template>
  <div>
    <el-form :inline="true" :model="username" class="demo-form-inline">
      <el-form-item label="姓名">
        <el-input placeholder="请输入姓名" v-model="username.name"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">查询</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import {  mapMutations } from 'vuex'
import { getUser } from '@/api/index.js'
export default {
  data() {
    return {
      username: {
        name: ''
      }
    }
  },
 
  
  methods: {
    ...mapMutations(['gettableData']),
    onSubmit() {
      this.getuserlist()
    },
    getuserlist() {
      getUser({ params: {  ...this.username } }).then(({ data }) => {
        // this.tableData = data.list
        this.gettableData(data)
      })
    }
  }
}
</script>

<style></style>
